#!/bin/bash

# Mask Token Spring Boot Starter 构建脚本

echo "开始构建 Mask Token Spring Boot Starter..."

# 清理并编译
echo "清理项目..."
mvn clean

echo "编译项目..."
mvn compile

echo "运行测试..."
mvn test

echo "打包项目..."
mvn package -DskipTests

echo "安装到本地仓库..."
mvn install -DskipTests

echo "构建完成！"
echo ""
echo "使用说明："
echo "1. 在其他项目中添加依赖："
echo "   <dependency>"
echo "     <groupId>com.mask</groupId>"
echo "     <artifactId>mask-token-spring-boot-starter</artifactId>"
echo "     <version>1.0.0</version>"
echo "   </dependency>"
echo ""
echo "2. 在 application.yml 中添加配置："
echo "   mask:"
echo "     token:"
echo "       secret: your-jwt-secret-key"
echo "       access-token-validity: PT2H"
echo "       refresh-token-validity: P7D"
echo ""
echo "3. 实现自定义的 UserDetailsService"
echo ""
echo "4. 使用 @RequireLogin, @RequireRole, @RequirePermission 注解进行权限控制"
